﻿#region Copyright

// All Material Copyright © 2010 Dynamic Concepts Development Corp., All Rights Reserved.
//      Portions Copyright © 1984-2009 Dynamic Concepts Development Corp., All Rights Reserved.
// For further information please contact: SoftwareSupport@dynconcepts.com
// Dynamic Concepts Development Corp.  311 W 57th St. Suite #422, New York, NY 10019

#endregion

#region Using References

using System.Windows;
using System.Windows.Controls;
using DynConDevCorp.OpenArch.DynAppFramework.Tiers.UserInterface.WPF.Engine;

#endregion

namespace DynConDevCorp.OpenArch.DynAppFramework.Tiers.UserInterface.WPF.UIElements
{
    /// <summary>
    /// Interaction logic for IconGridControl.xaml
    /// </summary>
    public partial class IconGridControl : UserControl
    {
        #region Constructors

        public IconGridControl()
        {
            InitializeComponent();
        }

        #endregion

        #region Public Methods

        public void AddItem(ControlPanelItem item)
        {
            TitledImage titledImage = new TitledImage
                                          {
                                              Title = item.Title,
                                              Graphic = item.Graphic,
                                              CommandHandler = item.CommandHandler,
                                              Width = 96,
                                              Height = 112,
                                              Margin = new Thickness(8, 8, 8, 8),
                                              VerticalAlignment = VerticalAlignment.Top
                                          };
            wpIconContainer.Children.Add(titledImage);
        }

        #endregion
    }
}